package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TDeliveryAddressMapper;
import com.ruoyi.system.domain.TDeliveryAddress;
import com.ruoyi.system.service.ITDeliveryAddressService;

/**
 * 收货地址Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-02-25
 */
@Service
public class TDeliveryAddressServiceImpl implements ITDeliveryAddressService 
{
    @Autowired
    private TDeliveryAddressMapper tDeliveryAddressMapper;

    /**
     * 查询收货地址
     * 
     * @param id 收货地址主键
     * @return 收货地址
     */
    @Override
    public TDeliveryAddress selectTDeliveryAddressById(Long id)
    {
        return tDeliveryAddressMapper.selectTDeliveryAddressById(id);
    }

    /**
     * 查询收货地址列表
     * 
     * @param tDeliveryAddress 收货地址
     * @return 收货地址
     */
    @Override
    public List<TDeliveryAddress> selectTDeliveryAddressList(TDeliveryAddress tDeliveryAddress)
    {
        return tDeliveryAddressMapper.selectTDeliveryAddressList(tDeliveryAddress);
    }

    /**
     * 新增收货地址
     * 
     * @param tDeliveryAddress 收货地址
     * @return 结果
     */
    @Override
    public int insertTDeliveryAddress(TDeliveryAddress tDeliveryAddress)
    {
        tDeliveryAddress.setCreateTime(DateUtils.getNowDate());
        return tDeliveryAddressMapper.insertTDeliveryAddress(tDeliveryAddress);
    }

    /**
     * 修改收货地址
     * 
     * @param tDeliveryAddress 收货地址
     * @return 结果
     */
    @Override
    public int updateTDeliveryAddress(TDeliveryAddress tDeliveryAddress)
    {
        return tDeliveryAddressMapper.updateTDeliveryAddress(tDeliveryAddress);
    }

    /**
     * 批量删除收货地址
     * 
     * @param ids 需要删除的收货地址主键
     * @return 结果
     */
    @Override
    public int deleteTDeliveryAddressByIds(Long[] ids)
    {
        return tDeliveryAddressMapper.deleteTDeliveryAddressByIds(ids);
    }

    /**
     * 删除收货地址信息
     * 
     * @param id 收货地址主键
     * @return 结果
     */
    @Override
    public int deleteTDeliveryAddressById(Long id)
    {
        return tDeliveryAddressMapper.deleteTDeliveryAddressById(id);
    }
}
